{% extends 'web_user/layout.html' %}
{% load static %}


{% block css %}
    <link rel="stylesheet" href="{% static 'bootstrap-datepicker/css/bootstrap-datepicker.min.css' %}">
{% endblock %}

{% block content %}
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
            <h3 class="panel-title">新建用户</h3>
            </div>
        </div>
        <div class="panel-body">
            <form method="post">
                {% csrf_token %}
                <div class="form-group">
                    <label>姓名</label>
                    <input type="text" class="form-control" placeholder="姓名" name="user">
                </div>
                <div class="form-group">
                    <label>密码</label>
                    <input type="text" class="form-control" placeholder="密码" name="pwd">
                </div>
                <div class="form-group">
                    <label>年龄</label>
                    <input type="text" class="form-control" placeholder="年龄" name="age">
                </div>
                <div class="form-group">
                    <label>工资</label>
                    <input type="text" class="form-control" placeholder="工资" name="salary">
                </div>
                <div class="form-group">
                    <label>入职时间</label>
                    <input id="dt" autocomplete="false" type="text" class="form-control" placeholder="入职时间" name="ct">
                </div>
                <div class="form-group">
                    <label>性别</label>
                    <select class="form-control" name="gd">
                        {% for item in gender_tup %}
                            <option value="{{ item.0 }}">{{ item.1 }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="form-group">
                    <label>部门</label>
                    <select class="form-control" name="dp">
                        {% for obj in depeart_list %}
                        <option value="{{ obj.id }}">{{ obj.titile }}</option>
                        {% endfor %}
                    </select>
                </div>
                <button type="submit" class="btn btn-primary">提交</button>
            </form>
        </div>
    </div>

{% endblock %}

{% block js %}
    <script src="{% static 'bootstrap-datepicker/js/bootstrap-datepicker.min.js' %}"></script>
    <script src="{% static 'bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js' %}"></script>
    <script>
        $(function (){
            $('#dt').datepicker({
                language: "zh-CN", <!--配置中文 -->
                startDate:'0',
                autoclose: true,   <!--自动关闭 -->
                format: "yyyy-mm-dd", <!--日期显示格式 -->
            });
        })
    </script>
{% endblock %}